var vm = new Vue({
    el:"#app",
    data:{
        refuseFlag: true, // 控制拒绝退款按钮是否显示
    },
    methods: {
        // 同意退款
        refund:function(){
            swal({
                title: "同意退款",
                text: "您是否同意退款？",
                buttons: ["取消", "确认"],
            })
            .then(function(flag){
                if (flag) {
                    console.log("确认");
                } else {
                    console.log("取消");
                }
            });
        },

        // 拒绝退款
        refuse:function(){
            var that = this;
            swal({
                content: {
                  element: "input",
                  attributes: {
                    value: "您已拒绝退款",
                    id:"inputBox",
                    disabled:true,
                    readonly:true
                  },
                },
                buttons:false,
                timer:800
            }).then(function(){
                that.refuseFlag = false;
            });
        },
    },
});